package com.example.glgk.mapper;

import com.example.glgk.dto.QueryEscalation;
import com.example.glgk.dto.UserInfo;
import com.example.glgk.dto.indicator.IndicatorCalculateDto;
import com.example.glgk.dto.report.ReportDto;
import com.example.glgk.dto.report.ReportSearchDto;
import com.example.glgk.dto.report.TaskSearchDto;
import com.example.glgk.entity.DepartmentIndicatorEntity;
import com.example.glgk.entity.report.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author lxk
 */
@Mapper
public interface ReportMapper {



    int update(@Param("entity") ReportEntity entity);

    List<ReportDto> queryReportData(@Param("search") ReportSearchDto search,
                                    @Param("indicators") List<String> indicators,
                                    @Param("processStatus")String processStatus);

    int save(@Param("entity") ReportEntity entity);

    void insertHistory(OperationHistoryEntity operationHistoryEntity);

    List<String> getTaskNames(@Param("userInfo")UserInfo userInfo);

    List<ReportTaskEntity> queryTask(@Param("taskSearchDto") TaskSearchDto taskSearchDto);

    List<ReportDto> queryByTaskId(ReportSearchDto search);

    List<OperationHistoryEntity> searchHistory(Integer taskId);

    List<ElementEntity> queryIndexValue(QueryIndexEntity indexEntity);

    List<String> selectDeptMent();

    void insertFJ(AttachmentEntity attachmentEntity);

    List<Map<String,String>> getIndicator();

    List<Map<String, String>> queryFj(@Param("deptId") String deptId,
                                      @Param("years") List<String> years,
                                      @Param("taskNames") List<String>  taskNames);

    List<Map<String, String>> queryAttachments(@Param("list") List<String> list);

    List<String> getDataSource();
    
    ReportTaskEntity queryReportTaskById(@Param("id") Integer id);

    int updateReportTaskStartTime(@Param("reportTaskEntity") ReportTaskEntity reportTaskEntity);

    List<OperationHistoryEntity> searchRejectHistory(@Param("taskId") Integer taskId);

    void uploadAdditionalFile(@Param("attachmentEntity") AttachmentEntity attachmentEntity);

    AttachmentEntity queryAttachmentsEntity(@Param("fileId") String fileId);

    void updateAttachmentsEntity(@Param("fileId") String fileId, @Param("newFileName") String newFileName);

    List<DepartmentIndicatorEntity> queryIndexValueNew(QueryEscalation queryEscalation);

    List<DepartmentIndicatorEntity> queryAnalysisReport(IndicatorCalculateDto indicatorCalculateDto);

    List<DepartmentIndicatorEntity> queryAnalysisReportByYear(IndicatorCalculateDto indicatorCalculateDto);
}
